package com.by.controller;

import com.by.common.core.bean.ResultBean;
import com.by.common.core.response.R;
import com.by.entity.Order;
import com.by.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/order")
public class OrderController {
    @Autowired
    OrderService orderService;

    @PostMapping("/saveOrder")
    public ResultBean save(@RequestBody Order order) {
        boolean rs = orderService.saveOrder(order);
        return rs ? R.success("保存成功") : R.fail("保存失败");
    }
}
